package com.zl.smartmall.library.po;

import java.util.HashMap;
import java.util.Map;
import net.tsz.afinal.annotation.sqlite.Id;
import net.tsz.afinal.annotation.sqlite.Property;
import net.tsz.afinal.annotation.sqlite.Table;
import net.tsz.afinal.annotation.sqlite.Transient;
import org.json.JSONException;
import org.json.JSONObject;
import com.zl.smartmall.library.util.Constants;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * 闪屏页面广告
 *
 */
public class AdvertInfopic implements Parcelable {

	private int id;
	private int width;
	private int height;
	private int advertType;
	private int affiliation;//属于什么位置的广告
	private String title;
	private String picture;
	private String valueMapJson;
	private Map<String, Object> valueMap = new HashMap<String, Object>();

	public AdvertInfopic(){
		
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public int getAdvertType() {
		return advertType;
	}

	public void setAdvertType(int advertType) {
		this.advertType = advertType;
	}

	public int getAffiliation() {
		return affiliation;
	}

	public void setAffiliation(int affiliation) {
		this.affiliation = affiliation;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getPicture() {
		return picture;
	}

	public void setPicture(String picture) {
		this.picture = picture;
	}  

	public String getValueMapJson() {
		return valueMapJson;
	}

	public void setValueMapJson(String valueMapJson) {
		this.valueMapJson = valueMapJson;
	}

	public Map<String, Object> getValueMap() {
		return valueMap;
	}

	public void setValueMap(Map<String, Object> valueMap) {
		this.valueMap = valueMap;
	}
	
	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(width);
		dest.writeInt(height);
		dest.writeInt(advertType);
		dest.writeInt(affiliation);
		dest.writeString(title);
		dest.writeString(picture);
		dest.writeString(valueMapJson);
	}
	public AdvertInfopic(Parcel source){
		width = source.readInt();
		height = source.readInt();
		advertType = source.readInt();
		affiliation = source.readInt();
		title = source.readString();
		picture = source.readString();
		valueMapJson = source.readString();
	}
	
	public static final Parcelable.Creator<AdvertInfopic> CREATOR = new Creator<AdvertInfopic>() {
		
		@Override
		public AdvertInfopic[] newArray(int size) {
			return new AdvertInfopic[size];
		}
		
		@Override
		public AdvertInfopic createFromParcel(Parcel source) {
			return new AdvertInfopic(source);
		}
	};
	
}
